package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.entity.user;
import org.springframework.stereotype.Service;

import java.util.List;

public interface usermapper {

    @Insert("insert into students (id name age gender) values (#{id},#{name},#{age},#{gender})")
    void insert(user student);

    @Delete("delete from students where id = #{id}")
    void delete(user student);

    @Update("update students set name = #{name} age = #{age} denfer = #{gender} where id = #{id}")
    void update(user student);

    @Select("select * from students where id = #{id}")
    user selectById(int id);

    @Select("select * from students")//查询全部 会多个参数 所以使用 集合来装
    List<user> selectAll();







}
